#include <bits/stdc++.h>

using namespace std;
#define int long long
const int inf = 0x3f3f3f3f;

void solve()
{
	int n;
	cin >> n;
	vector<int> a(n - 2);
	int start, last;
	cin >> start;
	for (int i = 0; i < n - 2; i++) cin >> a[i];
	cin >> last;
	if (a.empty() && 2 * start < last)
	{
		cout << -1 << '\n';
		return;
	}
	if (a.empty())
	{
		cout << 2 << '\n';
		return;
	}
	sort(a.begin(), a.end());
	int ans = 1;
	int now = start;
	int index = -1;
	while (1)
	{
		if (2 * now >= last)
		{
			ans++;
			break;
		}
		int it = lower_bound(a.begin() + index + 1, a.end(), 2 * now) - a.begin();
		if (it == a.size() || a[it] > 2 * now)
		{
			if (it - 1 <= index || a[it - 1] <= now)
			{
				cout << -1 << '\n';
				return;
			}
			ans++;
			index = it - 1;
			now = a[it - 1];
		}
		else if (a[it] == 2 * now)
		{
			ans++;
			now = a[it];
			index = it;
		}
	}
	cout << ans << '\n';
}

signed main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int _ = 1;
	cin >> _;
	while (_--)
	{
		solve();
	}
	return 0;
}